<?php
// +----------------------------------------------------------------------
// | genadmin [ genadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\admin\validate\article;

use think\Validate;

/**
 * 文档管理验证器
 */
class ArticleValidate extends Validate
{
    /**
     * 定义验证规则
     */
    protected $rule =   [
        'category_id' => 'require',
        'title' => 'require',
        'describe' => 'require',
        'content' => 'require',
        'file_type' => 'require',
        'release_time' => 'require',
    ];

    /**
     * 定义错误信息
     */
    protected $message  =   [
        'category_id' => '分类id必须填写',
        'title' => '文档标题必须填写',
        'describe' => '文档简介必须填写',
        'content' => '文档预览内容必须填写',
        'file_type' => '文档类型必须填写',
        'release_time' => '发布时间必须填写',
    ];

    /**
     * 定义场景
     */
    protected $scene = [
        'save' => [
            'category_id',
            'title',
            'describe',
            'content',
            'file_type',
            'release_time',
        ],
        'update' => [
            'category_id',
            'title',
            'describe',
            'content',
            'file_type',
            'release_time',
        ],
    ];

}
